package com.hlkj.pay.dto.common;
/*
 * Hlpay-Plus aggregate payment system.
 * Copyright (c) 2024-2025 Hlpay Team Copyright has the right of final interpretation.
 */

import java.math.BigDecimal;
import java.util.List;

import javax.validation.constraints.NotNull;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
/**
 * @author HlpayTeam
 * @date 2024/09/18 11:14
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class DefaultConfig {
	
	/**
	 * appFavicon : https://img.hbhlpay.com/uploads/images/20240828/2024082816114046a1c5716.png
	 * appShortName : 您好，欢迎使用汇联
	 * appName : 汇联科技
	 */
	@Schema(description ="商户默认配置")
	@NotNull(message = "商户默认配置 不能为空")
	private MerchantConfig merchantConfig;
	@Schema(description ="机构商默认配置")
	@NotNull(message = "商户默认配置 不能为空")
	private AgentConfig agentConfig;
	@Schema(description ="手续费充值默认账户")
	@NotNull(message = "手续费充值默认账户 不能为空")
	private RechargeConfig rechargeConfig;
	@Schema(description ="其它默认配置")
	@NotNull(message = "其它默认配置 不能为空")
	private OtherConfig otherConfig;
	
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	@Builder
	public static class MerchantConfig {
		/**
		 * profitSharingRules : 1
		 * commRateBase : 1
		 * autoApp : 0
		 */
		@Schema(description ="商户默认费率规则 1 平台手续费 2 机构规则 3 机构与平台手续费规则同时扣除")
		@NotNull(message = "商户默认费率规则 不能为空")
		private Integer profitSharingRules;
		@Schema(description ="商户默认手续费费率")
		@NotNull(message = "商户默认手续费费率 不能为空")
		private BigDecimal commRateBase;
		@Schema(description ="进件自动审核 0 关闭 1 开启")
		private Integer autoApp;
	}
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	@Builder
	public static class AgentConfig {
		/**
		 * profitSharingRules : 1
		 * commRateBase : 1
		 * autoApp : 0
		 */
		@Schema(description ="机构默认费率规则 1 平台手续费 2 机构规则 3 机构与平台手续费规则同时扣除")
		@NotNull(message = "机构默认费率规则 不能为空")
		private Integer profitSharingRules;
		@Schema(description ="机构默认手续费费率")
		@NotNull(message = "机构默认手续费费率 不能为空")
		private BigDecimal commRateBase;
		@Schema(description ="单笔分润提现最低金额")
		@NotNull(message = "单笔分润提现最低金额 不能为空")
		private BigDecimal minWithdrawalAmount;
		@NotNull(message = "提现月限制次数 不能为空")
		@Schema(description ="提现月限制次数")
		private Integer withdrawalCount;
		@Schema(description ="进件自动审核 0 关闭 1 开启")
		private Integer autoApp;
	}
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	@Builder
	public static class RechargeConfig {
		
		/**
		 * appid : APP_896564793562
		 * ins_id : M856437352
		 * pay_type : {"pc":["offWechatQr","offWechatPub"],"mobile":["offWechatQr"],"mini":["offWechatQr"],"app":["offWechatQr"]}
		 * maxmoney : 50000
		 * minmoney : 10
		 * status : 1
		 */
		@NotNull(message = "充值APPID 不能为空")
		@Schema(description ="充值APPID")
		private String appId;
		@NotNull(message = "充值商户号 不能为空")
		@Schema(description ="充值商户号")
		private String insId;
		@Schema(description ="支付方式")
		private PayType payType;
		@Schema(description ="最高充值金额")
		private BigDecimal maxMoney;
		@Schema(description ="最低充值金额")
		private BigDecimal minMoney;
		@Schema(description ="充值开关 0 关闭 1 开启")
		@NotNull(message = "充值开关 不能为空")
		private Integer status;
		@Data
		@NoArgsConstructor
		@AllArgsConstructor
		@Builder
		public  static class PayType {
			@Schema(description ="PC端支付方式")
			@NotNull(message = "PC端支付方式 不能为空")
			private List<String> pc;
			@Schema(description ="WAP端支付方式")
			private List<String> mobile;
			@Schema(description ="小程序内支付方式")
			private List<String> mini;
			@Schema(description ="APP端支付方式")
			private List<String> app;
		}
	}
	@Data
	@NoArgsConstructor
	@AllArgsConstructor
	@Builder
	public static class OtherConfig {
		@Schema(description ="默认服务商codes")
		@NotNull(message = "默认服务商 不能为空")
		private List<String> providerCodeList;
		@Schema(description ="默认通道codes")
		@NotNull(message = "默认通道 不能为空")
		private List<String> channelCodeList;
		
		@Schema(description ="是否使用电子合同  0 否 1 是 2 强制")
		private Integer esignFlag;
		@Schema(description ="退款退手续费（仅外扣手续费） 0 关闭 1 开启")
		private Integer refundFlag;
		@Schema(description ="修改进件是否收费  0 否 1 是")
		private Integer editApplyFlag;
	}
	
}
